M=1;
ave_g=0;
ave_c=0;
sig_g=0;
sig_c=0;
for j=1:M
    sigma=1;
    steps=100;
    gaussdata=[];
    colordata=[];
    color2data=[];
    ew1_L=0;
    ew2_L=0;
    ew1_NL=0;
    ew2_NL=0;
    for i=1:1:steps
        prac=sqrt(sigma)*randn(1,1);
        gaussdata=[gaussdata,prac];
    end
    for i=1:1:steps
        ew=sqrt(sigma)*randn(1,1);
        prac=ew+ew1_L*0.8-ew2_L*0.6;

        colordata=[colordata,prac];
        if i>2
            ew2_L=ew1_L;
        end
        if i>1
            ew1_L=ew;
        end
    end
     for i=1:1:steps
        ew=sqrt(sigma)*randn(1,1);
        prac=ew+ew1_L*ew1_L*0.8-ew2_L*0.6;

        color2data=[color2data,prac];
        if i>2
            ew2_L=ew1_L;
        end
        if i>1
            ew1_L=ew;
        end
    end
    xc_ave=mean(colordata);
    xg_ave=mean(gaussdata);
    ave_g=ave_g+xg_ave;
    ave_c=ave_c+xc_ave;
    sigma2c=0;
    sigma2g=0;
    for i=1:1:steps
        sigma2c=sigma2c+(colordata(i)-xc_ave)*(colordata(i)-xc_ave);
        sigma2g=sigma2g+(gaussdata(i)-xg_ave)*(gaussdata(i)-xg_ave);
    end
    sigma2c=sigma2c/steps;
    sigma2g=sigma2g/steps;
    sig_c=sig_c+sigma2c;
    sig_g=sig_g+sigma2g;
end
ave_g=ave_g/M
ave_c=ave_c/M
sig_g=sig_g/M
sig_c=sig_c/M
